home *** CD-ROM | disk | FTP | other *** search
/ Digitalfoto 118 / Digitalfoto 118.iso / mac / programas / 00 / start.swf / scripts / __Packages / com / robertpenner / easing / Circ.as < prev    next >
Text File  |  2009-11-16  |  743b  |  31 lines

  1. class com.robertpenner.easing.Circ
  2. {
  3.    function Circ()
  4.    {
  5.    }
  6.    static function easeIn(t, b, c, d)
  7.    {
  8.       return (- c) * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
  9.    }
  10.    static function easeOut(t, b, c, d)
  11.    {
  12.       return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
  13.    }
  14.    static function easeInOut(t, b, c, d)
  15.    {
  16.       if((t /= d / 2) < 1)
  17.       {
  18.          return (- c) / 2 * (Math.sqrt(1 - t * t) - 1) + b;
  19.       }
  20.       return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
  21.    }
  22.    static function easeOutIn(t, b, c, d)
  23.    {
  24.       if((t /= d / 2) < 1)
  25.       {
  26.          return c / 2 * Math.sqrt(1 - (t = t - 1) * t) + b;
  27.       }
  28.       return c / 2 * (2 - Math.sqrt(1 - (t = t - 1) * t)) + b;
  29.    }
  30. }
  31.